1. Field of the Invention
The present invention relates to communication networks and, more particularly, to a method and apparatus for selectively reading counter information in a network device.
2. Description of the Related Art
Data communication networks may include various routers, switches, nodes, hubs, proxies, and other network devices coupled to and configured to pass data to one another. These devices will be referred to herein as “network devices.” Data is communicated through the data communication network by passing data packets (or data cells, frames, or segments) between the network devices by utilizing one or more communication links between the devices. A particular packet may be handled by multiple network devices and cross multiple communication links as it travels between its source and its destination over the network.
As networks become more complex and the amount of traffic passing over the networks increases, the number of aspects of the network and the number of packets flowing through the network that must be monitored, or metered, also increases. For example, a router with 8 line cards, each of which is capable of supporting 30 Gigabits/sec, may handle over 60 million packets per second. The router/switch may also be responsible for keeping statistics on over 500 different aspects of the various flows being handled by the router/switch. For example, statistics may be collected on a per-VLAN basis, based on a combination of the physical port number, MAC source or MAC destination address, 802.1p Quality of Service (QoS) settings, and cast type such as unicast, multicast, or broadcast. The statistics may also relate to queuing, such as related to committed information rate for conforming bytes and packets, peak rate for conforming bytes and packets, and discards (bytes and packets). Numerous other statistics may be maintained as well, and the counters may be programmable to enable a given counter to be used for more than one purpose depending on the application for which the router/switch is to be utilized.
Since counters are typically limited in size by the hardware used to implement the processor, conventional network devices require the statistics to be harvested from all counters at least once in a given time period, such as once every 0.01 seconds. Unfortunately, the high volume of packets combined with the large number of counters requires the network device to dedicate considerable resources to statistics gathering and analysis. Moreover, many of the statistics counters may be relatively unpopulated even though one or more of the counters is in danger of overflowing. Accordingly, it would be advantageous to alter the statistics gathering paradigm to reduce the overhead associated with gathering information from counters to generate statistics.